## -- Attaching packages --------------------------------------- tidyverse 1.3.0 --
## v ggplot2 3.3.2 v purrr 0.3.4
## v tibble 3.0.4 v dplyr 1.0.2
## v tidyr 1.1.2 v stringr 1.4.0
## v readr 1.3.1 v forcats 0.5.0
## Warning: package 'tibble' was built under R version 4.0.3
## Warning: package 'tidyr' was built under R version 4.0.3
## Warning: package 'dplyr' was built under R version 4.0.3
## -- Conflicts ------------------------------------------ tidyverse_conflicts() --
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
##
## Attaching package: 'lubridate'
## The following objects are masked from 'package:base':
##
## date, intersect, setdiff, union
## Warning: package 'GGally' was built under R version 4.0.3
## Registered S3 method overwritten by 'GGally':
## method from
## +.gg ggplot2
##
## Attaching package: 'plotly'
## The following object is masked from 'package:formattable':
##
## style
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
Today’s post aims to analyse COVID-19 development in Serbia. We’re still using the same data source for this week: dataset retrieved from covid19 package (Guidotti and Ardia 2020).
Similarly, the data wrangling techniques performed for this blog post are the same as last week as the statistics provided are mostly cumulative. The tidyverse package (Wickham et al. 2019) was used to performed this wrangling. In addition to that, ggplot2 (Wickham 2016) and plotly (Sievert 2020) packages is used to present the data in plots.
This blog post will largely explore and analyse the following variables: daily_confirmed, daily_tests, daily_deaths.
## Adding missing grouping variables: `id`
## Warning: `group_by_()` is deprecated as of dplyr 0.7.0.
## Please use `group_by()` instead.
## See vignette('programming') for more help
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_warnings()` to see where this warning was generated.
Timeseries of COVID-19 confirmed cases, deaths, and tests in Serbia
Serbia began testing people for COVID-19 infections starting 26th February, and their first confirmed cases on 6th March. Figure @ref(fig:covid-overall) reflects the distributions of COVID-19 daily confirmed cases, deaths, and tests from 26th February. As shown in the figure, we can see multimodality characteristics in all these variables. In addition, it appears that the data for daily confirmed cases and deaths have a fair amount of missing values. This is indicated by the presence of gaps in the bar charts above. Another unusual thing is that the numbers for both daily confirmed cases and deaths for 26th of July is significantly higher than the rests. While there is no source to confirm this, it is fair to assume that this number is high to accommodate the missing value the day before (25th of July).
The graph indicates that there are two waves of COVID-19 cases in Serbia. The first wave of COVID-19 confirmed cases peaked in mid-April and then it started to subside. In early June, the number of confirmed cases of COVID-19 started to surged, and it reached its peak in late July. Similar to the first wave, the number of confirmed cases decreases after it reached its peak.
## Adding missing grouping variables: `id`
## Warning: Removed 3 rows containing missing values (position_stack).
Timeseries of COVID-19 confirmed cases with Government Imposed Restrictions
In this section, we are going to analyse how COVID-19 confirmed cases fluctuates as government rules on mobility restrictions changes. These fluctuations are plotted in figure @ref(fig:restriction-bar) where the confirmed cases time-series are faceted against government restrictions on social gatherings, school closing and stay home. The lower the restriction value, the lower the restrictions imposed by the government.
As expected, the government eases restrictions as the number of confirmed cases are manageable. As a result, however, the number of COVID-19 cases increases significantly not long after. For instance, after Serbia dealt with the first wave, the government started to lift restrictions, especially on stay home and social gathering. Not long after this, the second wave started to kick in. The government then thightened the restrictions just before the peak of the second wave.
Guidotti, Emanuele, and David Ardia. 2020. “COVID-19 Data Hub.” Journal of Open Source Software 5 (51): 2376. https://doi.org/10.21105/joss.02376.
Sievert, Carson. 2020. Interactive Web-Based Data Visualization with R, Plotly, and Shiny. Chapman; Hall/CRC. https://plotly-r.com.
Wickham, Hadley. 2016. Ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York. https://ggplot2.tidyverse.org.
Wickham, Hadley, Mara Averick, Jennifer Bryan, Winston Chang, Lucy D’Agostino McGowan, Romain François, Garrett Grolemund, et al. 2019. “Welcome to the tidyverse.” Journal of Open Source Software 4 (43): 1686. https://doi.org/10.21105/joss.01686.